<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2017/12/29
 * Time: 18:34
 */

namespace App\Http\Logics\Admin;


use App\StandardValue;
use App\Http\Logics\BaseLogic;
class StandardValueLogic extends BaseLogic
{
    /**
     * 创建规格值
     * @param $data 规格值信息
     * @return mixed 返回添加结果
     */
    public static function createStandardValue($data)
    {
        try {
            $standard_value = new StandardValue();
            $standard_value->standard_id = $data['standard_id'];
            $standard_value->value = $data['value'];
            if (!$standard_value->save()) {
                return self::response(self::OBJECT_SAVE_FAIL);
            }
            return self::response(self::SUCCESS);
        }catch (\Exception $e){
            return self::response(self::SYSTEM_ERROR);
        }
    }
}